package algorithm.arithmetic.日期计算;

import java.time.DateTimeException;
import java.time.LocalDate;

/**
 * @author xinchen by 2016/11/25
 * @version 1.0
 */
public class Solution {

    // 输入某年year(4位正整数)某月month（1-12）某日day（1-31），判断这一天是这一年的第几天。如果日期无效，请输出-1.
    public static void main(String[] args) {
        try {
            LocalDate date = LocalDate.of(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]));
            System.out.println(date.getDayOfYear());
        }catch (DateTimeException e){
            System.out.println(-1);
        }
    }
}
